<?php
/**
 * Created by PhpStorm.
 * User: 鄢鹏权
 * Date: 2017/10/19
 * Time: 11:07
 */
$content = file_get_contents('lib.lua');
$result = "";
$content = str_replace(["\r\n",'  '],["\n",' '],$content);
$content = str_replace(["\r\n",'  '],["\n",' '],$content);
$content = str_replace(["\r\n",'  '],["\n",' '],$content);
$content = str_replace(["\r\n",'  '],["\n",' '],$content);
$content = str_replace(["\r\n",'  '],["\n",' '],$content);
$content = str_replace(["\r\n",'  '],["\n",' '],$content);
$content = str_replace(["\r\n",'  '],["\n",' '],$content);
foreach (explode("\n",$content) as $row){
    if('--'==substr(trim($row),0,2)){

    }else{
        $result.=(' '.trim($row));
    }
}
$result = str_replace(['; ',', ',') ',' (','= ',' =',' }',' {'],[';',',',')','(','=','=','}','{'],$result);
file_put_contents('sos.lua',trim($result));